import request from "../utils/request";

// 用户列表请求接口
export const roleIndex = (data?: any) => {
  return new Promise(resolve => {
    request({
      url: "/pcapi/power/role_list", // url
      params: data
    }).then(res => {
      // 成功回调
      resolve(res);
    });
  });
};

// 用户添加请求接口
export const roleAdd = (data?: any) => {
  return new Promise(resolve => {
    request({
      url: "/pcapi/power/role_add", // url
      params: data
    }).then(res => {
      // 成功回调
      resolve(res);
    });
  });
};
// 用户编辑请求接口
export const roleEdits = (data?: any) => {
  return new Promise(resolve => {
    request({
      url: "/pcapi/power/role_update", // url
      params: data
    }).then(res => {
      // 成功回调
      resolve(res);
    });
  });
};
// 用户删除请求接口
export const roleDeletes = (data?: any) => {
  return new Promise(resolve => {
    request({
      url: "/pcapi/power/role_del", // url
      params: data
    }).then(res => {
      // 成功回调
      resolve(res);
    });
  });
};

// 菜单列表请求接口
export const powerIndex = (data?: any) => {
  return new Promise(resolve => {
    request({
      url: "/pcapi/power/rule_list", // url
      params: data
    }).then(res => {
      // 成功回调
      resolve(res);
    });
  });
};
